This work is supported by your donations. If you find this module usefull please donate.
paypal: marco@simplified.com.au or use the button above. Development time so far: ~4.8 days
Please look through the documentation if you have a problem.
Otherwise the support thread is here: ZenCart Forum Thread
To use volume filtering you must apply the sql patch provided in the zip archive (usps-volume_filtering.sql). Log into the zencart admin section, go to the Tools menu and select 'Install SQL Patches'. You can either upload tbe sql file or copy and paste the contents of the file into the text box.
Update modules.php (It only provides a warning in the shipping module admin if dimensions config is bad.)
modules.php (included in the archive) comes from ZenCart V1.3.9H
You can apply the change manually using the following code:
...... if (zen_not_null($set)) { ...... switch ($set) { ...... case 'shipping': /********************Code as Follows:*************************/ //Line 31 in modules.php - v1.3.9 if (defined('MODULE_SHIPPING_USPS_STATUS')) { //Check USPS Package Dimensions config $dimensions=zen_get_configuration_key_value('MODULE_SHIPPING_USPS_DIMENSIONS'); $dimensions=preg_replace(array('/^[\s,:]*/','/[\s,:]*$/'),'',$dimensions); //Strip leading and trailing whitespace + separators $dim_array=preg_split('/[\s,:]+/',$dimensions); foreach ($dim_array as $k=>$dparam) { if (!preg_match('/^(?P(?:\d{1,3}(?:\.\d{1,5})?x\d{1,3}(?:\.\d{1,5})?x\d{1,3}(?:\.\d{1,5})?)|regular);(?P \d{1,2}(?:\.\d{1,5})?|\+)(?:;(?P [NRV]))?$/', $dparam)) { $dimerr.='
The parameters set in Package Dimensions Config #'.($k+1).' are invalid'.($dimerr?'.':(', please enter valid shipping parameters. Current setting will be overridden with default: \'regular;+\'')); } } if (preg_match('/^\s*$/',$dimensions)) { $shipping_errors.='
You must enter valid dimension values. Current setting will be overridden with default: \'regular;+\''; } $shipping_errors.=$dimerr; } /*************************************************************/ if ($shipping_errors != '') { $messageStack->add(ERROR_SHIPPING_CONFIGURATION . $shipping_errors, 'caution'); } break; case 'ordertotal': ......
Many people ask why the weight shown in the quote is higher than the configured products weight. Usually it is caused by the tare setting.
Log into the admin section and check Config->Shipping.
Enter a percentage value, it uses the total value of the products in the order to calculate the discount.
If the percentage is 10% and $100 worth of products is quoted the shipping discount will be $10. If the shipping cost is less than $10 the cost is set to $0.00
You can sort by quote price. Alphanumericly by name. Or use the modules standard ordering which puts Express services at the top, followed by Priority, then First-Class and other services.
You may tick options like insurance, return receipt, delivery confirmation, etc and they will be applied to your quotes if they are available for that shipping service. If the selected options are not available for that service the charge will not be added. Please check USPS documentation for more info. Some services are only available online and some services may require you to go to the post office. If you enable debug mode you can see which options are added to a shipping service in the debug window.
Here you can vary package size based on the weight of the order. For example if I want to send packages under 20.5lb in a 6x5x12 box, 20.5-30lb in 8.3x12x15 box, and anything heavier in a 12x12x15 box then my config option would be:
6x5x12;20.5
8.3x12x15;30
12x12x15;+
I Recomend separating each parameter set with a new line but space , and : are also accepted.
'regular' in place of dimensions is equivalent to 12x12x12
After weight you may optionally set the package container. N=non-rectangular, R=rectangular, V=variable which only apply if any package dimensions are >12". V is the default option if nothing is specified.
eg: '15x5x3;+;R' is a valid config setting 15x5x3 dimensions with RECTANGULAR container for all quotes. These settings will not affect much until any dimensions exceed 12"
(Length)x(Width)x(Height);(Weight);(container)
Girth will be calculated from Width and Height values.
Note: If the minimum dimensions you set exceed 12" ('regular' size) certain shipping types will no longer be quoted. Check USPS Documentation for more info.
You can filter shipping services based on weight or volume. The specs of the flat rate options and envelope options have been coded into the module. If you enable filtering the module will check if the order can fit using the selected shipping services. Check the USPS Website for more information about dimensions/limitations on the services.
Services | Volume | Dimensions |
---|---|---|
Priority Mail International Large Flat Rate Box | 792 | 12x12x5.5 |
Priority Mail Large Flat Rate Box | 835 | 12x12x5.5 23.5x11.75x3 |
Priority Mail International Medium Flat Rate Box Priority Mail Medium Flat Rate Box | 515 | 11x8.5x5.5 13.5x11.75x3.25 |
Priority Mail International Small Flat Rate Box Priority Mail Small Flat Rate Box | 67 | 8.5x5.25x1.5 |
Priority Mail International DVD Flat Rate Box | 52 | 7.5x5.5x1.25 |
Priority Mail International Large Video Flat Rate Box | 95 | 9x6x1.75 |
USPS GXG Envelopes Express Mail International Flat Rate Envelope Priority Mail International Flat Rate Envelope Priority Mail International Padded Flat Rate Envelope First-Class Mail International Large Envelope | 70 | 11x8.5x0.75 |
Express Mail International Legal Flat Rate Envelope Priority Mail International Legal Flat Rate Envelope | 90 | 14x8.5x0.75 |
Priority Mail International Gift Card Flat Rate Envelope | 40 | 9x6x0.75 |
Priority Mail International Small Flat Rate Envelope | 34 | 9x5x0.75 |
Express Mail Legal Flat Rate Envelope Priority Mail Legal Flat Rate Envelope | 90 | 15x9.5x0.75 |
Express Mail Flat Rate Envelope Priority Mail Padded Flat Rate Envelope | 70 | 12.5x9.5x0.75 |
First-Class Mail International Letter | 15 | 9x6x0.25 |
Priority Mail Regional Rate Box A | 333.5 | 12.81x10.94x2.38 10x7x4.75 |
Priority Mail Regional Rate Box B | 656 | 15.88x14.38x2.25 12x10.25x5 |
You can edit the values in the module to suit if needed. If dimension or volume values are not provided the module will not do any filtering for that shipping service.
This allows you to control shipping service quoting independently of product weight. One benefit is that some products may be large but light or vice versa. You can customise shipping quotes based on the products or product attribute weight.
You must apply the SQL patch described above in the install instructions. Then you add extra information to the products weight field.
You specify a weight for 1 unit of a product in lb.
Eg: Product A weighs 0.0625 (lb)
So volume (cubic inches) is defined by digits 6-11 after decimal point.
eg: Product A is a big inflated balloon weighing 1oz and is 6859.3 cubic inches.
Products A's weight is set to: 0.06250685930
USPS will not ship anything much larger so this impementation should cover all posibilities. The above also works for product attribute weights.
This allows you to control shipping service quoting based on the dimensions configuration above.
Module weight/dimensions config example:8x5x1.5;0.5 11x8x5;3 12x12x5;6 regular;+
Assuming the flat rate options are selected, this configuration will quote:
Small FR box for items 0.5lb or less.
Medium FR for items 3lb or less
Large FR for items 6lb or under
All Flat rate options are filtered once weight is over 6lb
You can use this and customise the weights to your liking.
If you are having trouble with module configuration and filtering debug mode is extremely usefull. I recomend using the 'XML Dump' debug option for convenience. It will show volume/dimensions/weight and configuration information. It will show how quote options are filtered and exposes many of the issues that might occur.
Package Error: If you notice this come up in debug mode it is safe to ignore. This is an informational warning only. One example is when first class is selected and the weight is over what USPS allow. When the module detects this the service does not appear in the options list. Once debug mode is off this error is silent.
V1.00 - Initial Release v1.01 - Improved this documentation Now rounding Ounces and inches to 1 decimal place before sending a request to USPS This shouldn't affect USPS quoting since pricing granularity is 1 oz or 1" increments minimum. Updated modules.php and usps.php code to improve the dimensions checking. v1.02 - Bugfix: For Domestic Shipping the customer's USPS Selection would be ignored and the first option would be used. v1.1 - Bugfix: Fixed weight/dimensions selection code. There was a problem when 'regular' was used. Added Request Cache and other code optimisation. Improved Debug Mode - Debug mode now shows filtering and various other information. XML Debug mode now hides the USPS user id used to retrieve the quotes. Added Weight/Dimension filtering Added Volume filtering Added Support for insurance and other optional USPS Services v1.2 - Added Quote Discount Setting Added sort options for shipping quotes. Can sort by price or name. Improved documentation Improved shipping estimator functionality. Does not request a quote from USPS when a postcode is not provided. Changed module default options - now fewer options selected on a fresh install. Updated hardcoded volume/dimensions for some shipping options for consistency between International and Domestic (where possible) v1.21 - Bugfix: Request Cache didn't respond to some address changes - caused by v1.2 code changes.